#!/bin/bash
if [ -n "$2" ]
then
	do_date=$2
else
	do_date= $(date -d yesterday +%F) 
fi

echo 当前要操作的日期是$do_date

dim_activity_full="

"
dim_coupon_full="

"
dim_date="

"
dim_province_full="

"
dim_sku_full="

"
dim_user_zip="

"

case $1 in
"dim_activity_full")
	hive --database gmall -e "$dim_activity_full"
	;;
"dim_coupon_full")
	hive --database gmall -e "$dim_coupon_full"
	;;
"dim_date")
	hive --database gmall -e "$dim_date"
	;;
"dim_province_full")
	hive --database gmall -e "$dim_province_full"
	;;
"dim_sku_full")
	hive --database gmall -e "$dim_sku_full"
	;;
"dim_user_zip")
	hive --database gmall -e "$dim_user_zip"
	;;
"all")
	hive --database gmall -e "$dim_activity_full$dim_coupon_full$dim_date$dim_province_full$dim_sku_full$dim_user_zip"
	;;
esac

